/****************************************************************************
**
** Copyright (C) 2012 Denis Shienkov <denis.shienkov@gmail.com>
** Copyright (C) 2012 Laszlo Papp <lpapp@kde.org>
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtSerialPort module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/

#ifndef CONSOLE_H
#define CONSOLE_H

#include <QPlainTextEdit>
#include <QTableWidget>
#include<QTableView>
#include <QStandardItemModel>
#include <QtCore/QDebug>

class Console : public QTableWidget
{
    Q_OBJECT
public:

int RowCount;
int selectRow;
QString Name_path;
QString Sex_path;
QString Max_path;
QString Min_path;
QString Read_path;
QString File_Path;

QByteArray esex;
QByteArray emax;
QByteArray emin;
QByteArray eval;
QByteArray etest;

void        max_list(int    RowCount);
QString     name_list(int    RowCount);
void        sex_list(int    RowCount);
void        min_list(int    RowCount);
    explicit Console(QWidget *parent = 0);
void    Txt_Data();
void    struct_Size(int  file_sum);
void    path_save(QString   file);

void    Name_file_read(QString  Name_read);
void    Max_file_read(QString  Max_read);
void    Sex_file_read(QString  Sex_read);
void    Min_file_read(QString  Min_read);
void    Read_file_read(QString  Read_date);
void setLocalEchoEnabled(bool set);
signals:
void    Progress(int p_number);
void    New_pass(int    p_name);
void    New_fall(int    f_name);
void    New_pass_windos();
void    New_fall_windos();
protected:
    virtual void mousePressEvent(QMouseEvent *e);
    virtual void mouseDoubleClickEvent(QMouseEvent *e);
    virtual void contextMenuEvent(QContextMenuEvent *e);
    virtual void    resizeEvent(QResizeEvent *event);
private:

bool localEchoEnabled;
int sum;
int i;
int    I;
int pass_las=0;
int fall_las=0;
void    Send_pass()
{
    emit    New_pass(p_name);
}
void    Send_fall()
{
    emit    New_fall(f_name);
}
void    Send_fall_windos()
{
    emit    New_fall_windos();
}
void    Send_pass_windos()
{
    emit    New_pass_windos();
}
void    progress()
{

    emit    Progress(p_number);

}

int f_name;
int p_name;
int p_number;
};

#endif // CONSOLE_H
